--利至无论
local lizhiwulun = fk.CreateSkill {
    name = "mcdh_lizhiwulun",
}

local U = require "packages/utility/utility"
local lib = require "packages/mcdh/lib"

lizhiwulun:addEffect(fk.TargetConfirmed,{
    can_trigger = function(self, event, target, player, data)
        return target == player and player:hasSkill(self) and player:usedSkillTimes(self.name) < 1
    end,
    on_cost = function(self, event, target, player, data)
        return player.room:askForSkillInvoke(player, self.name, nil, "#mcdh_lizhiwulun-invoke:" .. data.from)
    end,
    on_use = function(self, event, target, player, data)
        local room = player.room
        local user = data.from
        local cid = room:getNCards(1, "bottom")[1]
        room:moveCardTo(cid, Card.Processing, nil, fk.ReasonJustMove, self.name)
        if Fk:getCardById(cid).color == Card.Red then
            room:drawCards(user, 1, self.name)
        elseif Fk:getCardById(cid).color == Card.Black then
            room:loseHp(user, 1, self.name)
        end
        room:moveCardTo(cid, Card.DiscardPile, nil, fk.ReasonJustMove, self.name)
    end,
})

Fk:loadTranslationTable {
    ["mcdh_lizhiwulun"] = "唯利",
    [":mcdh_lizhiwulun"] = "『利至无论』<br>每回合限一次，当一名角色使用牌指定你为目标后，你可以亮出牌堆底的一张牌，若此牌为红色/黑色，其摸一张牌/失去1点体力。",
    ["#mcdh_lizhiwulun-invoke"] = "利至无论：你可以亮出牌堆底的牌<br>红色， %src 摸牌；黑色，其失去体力"
}
return lizhiwulun